/*
** main.c for zappy in /home/morgan_t/zappy-2015-2014s-suon_a/server
** 
** Made by thomas morgant
** Login   <morgan_t@epitech.net>
** 
** Started on  Mon Jun 18 12:18:09 2012 thomas morgant
** Last update Thu Jul 12 16:11:36 2012 thomas morgant
*/

#include "conf.h"
#include "server.h"
#include "check.h"

void	print_param(t_serv *serv)
{
printf("-port: %d\n-width:%d\n-hight:%d\n-nb_player:%d\n-time:%d\n-team:%s, %s\n",
       serv->port, serv->width, serv->height, serv->client_in_team, serv->time, serv->team1, serv->team2);
}

void    print_map(t_map *map)
{
  t_map *tmp;

  tmp = map;
  while (tmp)
    {
      printf("x:%d - y:%d\n", tmp->width, tmp->height);
      printf("food:%d\nlin:%d\nder:%d\nsib:%d\nmen:%d\nphi:%d\nthy:%d\n",
             tmp->tab[0], tmp->tab[1], tmp->tab[2], tmp->tab[3],
             tmp->tab[4], tmp->tab[5], tmp->tab[6]);
      printf("##########\n");
      tmp = tmp->next;
    }
}
 
int	main(int ac, char **av)
{
  t_serv	serv;

  init_struct_serv(&serv);
  if (ac != 14)
    {
      printf(USAGE);
      exit(EXIT_FAILURE);
    }
  printf("test\n");
  get_params(&serv, ac, av);
  print_param(&serv);
  map(&serv);
  print_map(serv.map);
  run(&serv, ac, av);
  return (0);
}
